<template>
        <div class="mui-numbox"  data-numbox-min='1' data-numbox-max='9' style="height:25px;">
            <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
            <input id="test" class="mui-input-numbox" type="number" :value="count" 
            @change="countChange" ref="numbox"/>
            <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
		</div>
</template>

<script>
import mui from '../../lib/mui/js/mui.min.js'
export default { 
    props:['count','shopid'],
    data() {
        return {

        };
    },
    mounted(){
        mui(".mui-numbox").numbox();
    },
    methods: {
        //文本框数据改变时传值给父组件
        //当文本只是数字的时候，注意parseInt
        countChange(){
            // this.$emit('func',parseInt(this.$refs.numbox.value))
            // console.log(this.$refs.numbox.value)
            // console.log(this.shopid+'-----'+this.$refs.numbox.value)

            this.$store.commit('updateShopInfolist',{
                id:this.shopid,
                count:this.$refs.numbox.value
            })
        }
        
    },
};
</script>

<style scoped lang="scss">

</style>
